{php include pubTemplate("header")}
<div class="container">
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
            <li class="breadcrumb-item"><a href="{tsUrl('article')}">{$TS_APP['appname']}</a></li>
            {if $strArticle['cate']}
            <li class="breadcrumb-item">{if $strArticle['cate']}<a href="{tsUrl('article','cate',array('id'=>$strArticle['cate']['cateid']))}">{$strArticle['cate']['catename']}</a>{/if}</li>
            {/if}
            <li class="breadcrumb-item active" aria-current="page">{$strArticle[title]}</li>
        </ol>
    </nav>

    <div class="mb-3">
        <a class="btn btn-sm {if $cateid=='0'}btn-outline-secondary{else}text-secondary{/if}" href="{tsUrl('article')}">全部</a>
        {loop $arrCate $key $item}
        <a class="btn btn-sm {if $cateid==$item['cateid']}btn-outline-secondary{else}text-secondary{/if}" href="{tsUrl('article','cate',array('id'=>$item['cateid']))}">{$item['catename']}</a>
        {/loop}
    </div>

    <div class="row">

        <div class="col-md-8">

            <div class="card">
                <div class="card-body">

                    <h1 class="h5 pb-3 font-weight-bold">{$strArticle[title]}</h1>

                    <div class="media mt-3 mb-3">

                        <a class="mr-3" href="{tsUrl('user','space',array('id'=>$strArticle['user']['userid']))}"><img class="media-object rounded-circle" title="{$strArticle['user']['username']}" alt="{$strArticle['user']['username']}" src="{$strArticle['user']['face']}" width="36" height="36"></a>


                        <div class="media-body">
                            <div><a href="{tsUrl('user','space',array('id'=>$strArticle['userid']))}">{$strArticle['user']['username']}</a></div>
                            <div class="c9 fs12">发表于 {$strArticle['addtime']}</div>
                        </div>
                    </div>

                    {if $strArticle['tags']}
                    <div class="mb-3 mt-3">
                        {loop $strArticle['tags'] $key $item}
                        <a class="badge badge-secondary fw300 mr-2" href="{tsUrl('article','tag',array('id'=>$item['tagname']))}">{$item['tagname']}</a>
                        {/loop}
                    </div>
                    <div class="clear"></div>
                    {/if}


                    {if $isread==1}
                    <div class="alert alert-info">查看文章需要支付 <span class="text-danger">{$strArticle['score']}积分</span> <a class="btn btn-sm btn-success" href="javascript:void('0');" onclick="tsPost('index.php?app=article&ac=score&ts=pay',{'articleid':'{$articleid}'})">支付</a></div>
                    {else}

                    <div class="article_show_content lh30 common-content">

                        {$strArticle[content]}

                        {$tpUrl}

                    </div>
                    {/if}


                    <!--文章内容底部插件钩子-->
                    <div>{php doAction('article_show_footer')}</div>


                    <div class="mt-3">{php doAction('gobad','468')}</div>


                    <div class="of mt-3">


                        <div class="float-left c9 fw300 pt-1">

                            <i class="far fa-eye"></i> {$strArticle['count_view']}

                            <i class="far fa-comment ml-3"></i> {$strArticle['count_comment']}

                        </div>

                        {if $TS_USER[isadmin]==1 || $TS_USER['userid']==$strArticle['userid']}
                        <div class="float-right text-right">

                            <a class="btn btn-outline-secondary btn-sm" href="{SITE_URL}index.php?app=article&ac=edit&articleid={$strArticle['articleid']}"><i class="far fa-edit"></i> 修改</a>
                            <a onclick="return confirm('确定删除?')" class="btn btn-outline-secondary btn-sm" href="{SITE_URL}index.php?app=article&ac=delete&articleid={$strArticle['articleid']}&token={$_SESSION['token']}"><i class="far fa-trash-alt"></i> 删除</a>
                        </div>
                        {/if}


                    </div>

                    <hr />

                    {if $strUp}
                    <div class="fs13 text-secondary">上一篇：<a class="text-secondary" href="{tsUrl('article','show',array('id'=>$strUp['articleid']))}">{$strUp['title']}</a></div>
                    {/if}
                    {if $strNext}
                    <div class="fs13 text-secondary">下一篇：<a class="text-secondary" href="{tsUrl('article','show',array('id'=>$strNext['articleid']))}">{$strNext['title']}</a></div>
                    {/if}




                </div>
            </div>


            <div class="card">
                <div class="card-header">评论{if $strArticle['count_comment']} <small class="text-secondary">({$strArticle['count_comment']})</small>{/if}</div>
                <div class="card-body">




                    <!--评论列表-->
                    {php include pubTemplate("comment")}





                    <div class="commentform">
                        
                        {if tsIntval($TS_USER[userid])==0}
                            <div class="tac pd20 fw300">
                                <a href="{tsUrl('user','login')}">登录</a> | <a href="{tsUrl('user','register')}">注册</a>
                            </div>
                            {else}

                            <form id="comm-form" method="post" action="{SITE_URL}index.php?app=pubs&ac=comment&ts=do">
                                <div >
                                    <textarea id="tseditor" name="content"></textarea>
                                </div>
                                <div class="row mt-3">
                                    <div class="col-md-6">
                                        {if $TS_SITE['isauthcode']}
                                        <input class="form-control form-control-sm w-auto float-left" name="authcode" placeholder="输入验证码" />
                                        <img class="mt-1 ml-1" src="{tsUrl('pubs','code')}" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
                                        {/if}
                                    </div>
                                    <div class="col-md-4">
                                        <div class="mt-1">是否公开：<input type="radio" name="ispublic" value="0" checked />公开 <input type="radio" name="ispublic" value="1" />不公开</div>
                                    </div>
                                    <div class="col-md-2 text-right">
                                        <input type="hidden" name="ptable" value="article">
                                        <input type="hidden" name="pkey" value="articleid">
                                        <input type="hidden" name="pid" value="{$strArticle['articleid']}" />
                                        <input type="hidden" name="token" value="{$_SESSION['token']}" />
                                        <button class="btn btn-sm btn-info btn-block" type="submit">提交评论</button>
                                    </div>
                                </div>
                            </form>
                            {/if}

                    </div>

                </div>
            </div>





            <div class="card">
                <div class="card-header">最新文章</div>
                <div class="card-body">

                    <div class="commlist">
                        <ul>
                            {loop $arrArticle $key $item}
                            <li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{php echo tsTitle($item['title'])}</a></li>
                            {/loop}
                        </ul>
                    </div>

                </div>
            </div>


        </div>

        <div class="col-md-4">


            <div class="card">
                <div class="card-header">推荐阅读</div>
                <div class="card-body">
                    <div class="commlist">
                        <ul>
                            {loop $arrRecommend $key $item}
                            <li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a></li>
                            {/loop}
                        </ul>
                    </div>
                </div>
            </div>


            <div class="card">
                <div class="card-header">一周热门</div>
                <div class="card-body">
                    <div class="commlist">
                        <ul>
                            {loop $arrHot7 $key $item}
                            <li><a
                                    href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a></li>
                            {/loop}
                        </ul>
                    </div>
                </div>

            </div>

            <div class="card">
                <div class="card-header">一月热门</div>
                <div class="card-body">
                    <div class="commlist">
                        <ul>
                            {loop $arrHot30 $key $item}
                            <li><a
                                    href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a></li>
                            {/loop}
                        </ul>
                    </div>
                </div>

            </div>

            <!--广告位-->
            {php doAction('gobad','300')}
        </div>

    </div>
</div>
{php doAction('tseditor','mini')}
{php include pubTemplate("footer")}
